package vn.edu.nuce.dao;

import java.util.List;

import org.hibernate.SessionFactory;

import vn.edu.nuce.model.TietHoc;

public class TietHocDaoImpl implements TietHocDao{
	private SessionFactory sessionFactory;

	public SessionFactory getSessionFactory() {
		return sessionFactory;
	}

	public void setSessionFactory(SessionFactory sessionFactory) {
		this.sessionFactory = sessionFactory;
	}

	public List<TietHoc> getTietHocList() {
		return getSessionFactory().getCurrentSession().createQuery("from TietHoc").list();
	}

	public TietHoc getById(String id) {
		return (TietHoc) getSessionFactory().getCurrentSession().get(TietHoc.class, id);
	}

}
